package com.sgb.merchant.view.activity;

import android.view.View;

import androidx.lifecycle.ViewModelProvider;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.sgb.link.entity.merchant.DynamicListEntity;
import com.sgb.link.router.PathMerchant;
import com.sgb.merchant.R;
import com.sgb.merchant.databinding.MerchantActivityDynamicDetailBinding;
import com.sgb.merchant.viewmodel.IndustryViewModel;
import com.swgk.core.base.model.entity.RouterKey;
import com.swgk.core.common.base.BaseActivity;

/**
 * @author: 王彬臣
 * @date: 2021/10/14
 * @Description: 产业园区动态详情
 */
@Route(path = PathMerchant.DynamicDetailActivity)
public class DynamicDetailActivity extends BaseActivity<IndustryViewModel, MerchantActivityDynamicDetailBinding> {
    @Autowired(name = RouterKey.DATA)
    DynamicListEntity mEntity;
    @Override
    protected int layoutId() {
        return R.layout.merchant_activity_dynamic_detail;
    }

    @Override
    protected void createViewModel() {
         mViewModel=new ViewModelProvider(this).get(IndustryViewModel.class);
    }

    @Override
    protected void init() {
        ARouter.getInstance().inject(this);
        mBinding.includeTitle.ivBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        mBinding.includeTitle.titleView.setText("查看动态详情");
        if(mEntity!=null){
            mBinding.setViewModel(mEntity);
        }

    }
}
